package cn.b.sky.schedule.model;

import cn.b.sky.common.model.ImeCommon;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;

public class TimedJobInfo extends ImeCommon implements Serializable {

  /**
   * serialVersionUID
   */
  private static final long serialVersionUID = -2589096732673431717L;

  // 作业代码
  private String jobCode;

  // 作业描述
  private String jobDesc;

  // 作业类名（包含package的全路径）
  private String jobClass;

  // cron表达式的描述（如：每天凌晨12点执行）
  private String cronDesc;

  // 完整的cron表达式
  private String cronExpression;

  // 上次执行时间
  private Date lastExecutionTime;

  // 是否启用标志
  private Integer enableFlag;

  /**
   * 是否并发执行，0-并行 1--串行，默认并行
   */
  private int concurrent = 0;
  //时区
  private String javaTimeZone;

  public String getJobCode() {
    return jobCode == null ? "" : StringUtils.upperCase(jobCode);
  }

  public void setJobCode(String jobCode) {
    this.jobCode = StringUtils.upperCase(jobCode);
  }

  public String getJobDesc() {
    return jobDesc == null ? "" : jobDesc;
  }

  public void setJobDesc(String jobDesc) {
    this.jobDesc = jobDesc;
  }

  public String getJobClass() {
    return jobClass == null ? "" : jobClass;
  }

  public void setJobClass(String jobClass) {
    this.jobClass = jobClass;
  }

  public String getCronDesc() {
    return cronDesc == null ? "" : cronDesc;
  }

  public void setCronDesc(String cronDesc) {
    this.cronDesc = cronDesc;
  }

  public String getCronExpression() {
    return cronExpression == null ? "" : cronExpression;
  }

  public void setCronExpression(String cronExpression) {
    this.cronExpression = cronExpression;
  }

  public Date getLastExecutionTime() {
    return lastExecutionTime;
  }

  public void setLastExecutionTime(Date lastExecutionTime) {
    this.lastExecutionTime = lastExecutionTime;
  }

  public Integer getEnableFlag() {
    return enableFlag;
  }

  public void setEnableFlag(Integer enableFlag) {
    this.enableFlag = enableFlag;
  }

  public String getJavaTimeZone() {
    return javaTimeZone;
  }

  public void setJavaTimeZone(String javaTimeZone) {
    this.javaTimeZone = javaTimeZone;
  }

  public int getConcurrent() {
    return concurrent;
  }

  public void setConcurrent(int concurrent) {
    this.concurrent = concurrent;
  }

}
